home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / AMScen_0_9.lha / AMScen / icons.m < prev    next >
Text File  |  1995-01-21  |  6KB  |  222 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1995 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * icons.m - code for dealing with icons.
  9.  *
  10.  *    Note: the makeXXXIcon routines were generated by the icons.d Draco
  11.  *        program.
  12.  */
  13.  
  14. /*
  15.  * ShowIcon - show this machine's icon to anyone here.
  16.  */
  17.  
  18. define t_icons proc utility public ShowIconOnce(thing th)void:
  19.     thing me;
  20.  
  21.     me := Me();
  22.     GShowIcon(th, me, not me@p_pStandard, Parent(me) ~= nil);
  23. corp;
  24.  
  25. define t_icons proc utility public ShowIcon()void:
  26.  
  27.     ForEachAgent(Here(), ShowIconOnce);
  28. corp;
  29.  
  30. /*
  31.  * DoShowIcon - handy for ForceAction on an arriving entity.
  32.  */
  33.  
  34. define t_icons proc utility public DoShowIcon()status:
  35.  
  36.     ShowIcon();
  37.     continue
  38. corp;
  39.  
  40. /*
  41.  * UnShowIcon - remove my icon from anyone else here.
  42.  */
  43.  
  44. define t_icons proc utility UnShowIconOnce(thing th)void:
  45.     thing me;
  46.  
  47.     me := Me();
  48.     if (me@p_pIcon ~= nil or me@p_pStandard) and Parent(me) = nil then
  49.     /* If the player or machine has a specific icon, or this is a
  50.        player or a "standard" machine (Packrat, etc.), and this is
  51.        not a cloned entity, then we just tell the client to undisplay
  52.        the icon, but to remember it for later use. */
  53.     GRemoveIcon(th, me);
  54.     else
  55.     /* Otherwise, we tell the client to undisplay the icon, but also to
  56.        forget it, since the thing associated with it may be reused later
  57.        for something with a different icon. */
  58.     GDeleteIcon(th, me);
  59.     fi;
  60. corp;
  61.  
  62. define t_icons proc utility public UnShowIcon()void:
  63.  
  64.     ForEachAgent(Here(), UnShowIconOnce);
  65. corp;
  66.  
  67. /*
  68.  * DoUnShowIcon - handy for ForceAction on a leaving entity.
  69.  */
  70.  
  71. define t_icons proc utility public DoUnShowIcon()status:
  72.  
  73.     UnShowIcon();
  74.     continue
  75. corp;
  76.  
  77. /*
  78.  * PrintIcon - print an icon in binary form.
  79.  */
  80.  
  81. define t_icons proc PrintIcon(list int icon)void:
  82.     int i, bits, j;
  83.  
  84.     for i from 0 upto 7 do
  85.     Print("icon[" + IntToString(i) + "] := 0b");
  86.     bits := icon[i];
  87.     for j from 0 upto 31 do
  88.         if bits < 0 then
  89.         Print("1");
  90.         else
  91.         Print("0");
  92.         fi;
  93.         bits := bits << 1;
  94.     od;
  95.     Print(";\n");
  96.     od;
  97. corp;
  98.  
  99. /*
  100.  * some specific icons
  101.  */
  102.  
  103. define t_icons proc makeCaretakerIcon()list int:
  104.     list int icon;
  105.  
  106.     icon := CreateIntArray(8);
  107.     icon[0] := 0b00000000000000000001100000000000;
  108.     icon[1] := 0b00011000000000000000110000000000;
  109.     icon[2] := 0b00001100000000000000011000000000;
  110.     icon[3] := 0b00000110000000000000001100000000;
  111.     icon[4] := 0b00000011000000000000000110000000;
  112.     icon[5] := 0b00000001111000000000001111100000;
  113.     icon[6] := 0b00000011111100000000000111110000;
  114.     icon[7] := 0b00000001100000000000000000000000;
  115.     icon
  116. corp;
  117.  
  118. define t_icons proc makePackratIcon()list int:
  119.     list int icon;
  120.  
  121.     icon := CreateIntArray(8);
  122.     icon[0] := 0b00000000000000000000000000000000;
  123.     icon[1] := 0b00000000000000000000000100000000;
  124.     icon[2] := 0b00000010100000000001101011100000;
  125.     icon[3] := 0b00100111100100000001111111100000;
  126.     icon[4] := 0b00000111010000000000110110100000;
  127.     icon[5] := 0b00010101011000000010001000000000;
  128.     icon[6] := 0b00100000000000000100000000000000;
  129.     icon[7] := 0b01000000000000000000000000000000;
  130.     icon
  131. corp;
  132.  
  133. define t_icons proc makePostmanIcon()list int:
  134.     list int icon;
  135.  
  136.     icon := CreateIntArray(8);
  137.     icon[0] := 0b00000000000000000000000000000000;
  138.     icon[1] := 0b00000000000000000000000000000000;
  139.     icon[2] := 0b01111111111111100111000000001110;
  140.     icon[3] := 0b01001100001100100100001111000010;
  141.     icon[4] := 0b01000000000000100111111111111110;
  142.     icon[5] := 0b00000000000000000000000000000000;
  143.     icon[6] := 0b00000000000000000000000000000000;
  144.     icon[7] := 0b00000000000000000000000000000000;
  145.     icon
  146. corp;
  147.  
  148. define t_icons proc makeQuestorIcon()list int:
  149.     list int icon;
  150.  
  151.     icon := CreateIntArray(8);
  152.     icon[0] := 0b00000000000000000000000000000000;
  153.     icon[1] := 0b00000111111000000001100000011000;
  154.     icon[2] := 0b00100000000001000100000000000010;
  155.     icon[3] := 0b01000000000000100100000000000010;
  156.     icon[4] := 0b01000000000000100100100000000010;
  157.     icon[5] := 0b01000110000000100010000110000100;
  158.     icon[6] := 0b00011000010110000000011111100000;
  159.     icon[7] := 0b00000000000111000000000000000011;
  160.     icon
  161. corp;
  162.  
  163. define t_icons proc makeMerlinIcon()list int:
  164.     list int icon;
  165.  
  166.     icon := CreateIntArray(8);
  167.     icon[0] := 0b00000000000000000000000000000000;
  168.     icon[1] := 0b00000001111110000000001000000100;
  169.     icon[2] := 0b00000100001110100000010000100110;
  170.     icon[3] := 0b00001000000100000000100000010000;
  171.     icon[4] := 0b00010010010010000001000110001000;
  172.     icon[5] := 0b00100111111001000010000110000100;
  173.     icon[6] := 0b01000010010000100100000000000010;
  174.     icon[7] := 0b00111111111111000000000000000000;
  175.     icon
  176. corp;
  177.  
  178. define t_icons proc makeWandererIcon()list int:
  179.     list int icon;
  180.  
  181.     icon := CreateIntArray(8);
  182.     icon[0] := 0b00000000000000000000011111100000;
  183.     icon[1] := 0b00001000000100000001000000001000;
  184.     icon[2] := 0b00100011110001000100010000100010;
  185.     icon[3] := 0b01001000000100100100100110010010;
  186.     icon[4] := 0b01001001100100100100100000010010;
  187.     icon[5] := 0b01000100001000100010001111000100;
  188.     icon[6] := 0b00010000000010000000100000010000;
  189.     icon[7] := 0b00000111111000000000000000000000;
  190.     icon
  191. corp;
  192.  
  193. define t_icons proc makeBirdIcon()list int:
  194.     list int icon;
  195.  
  196.     icon := CreateIntArray(8);
  197.     icon[0] := 0b00000000000000000000011110000000;
  198.     icon[1] := 0b00011111110000000011111111100000;
  199.     icon[2] := 0b00111111111000000111111011111000;
  200.     icon[3] := 0b01111110011111100111111111110000;
  201.     icon[4] := 0b01111111111111100111111111110000;
  202.     icon[5] := 0b00111111111000000011111111000000;
  203.     icon[6] := 0b00011111110000000000011110000000;
  204.     icon[7] := 0b00000000000000000000000000000000;
  205.     icon
  206. corp;
  207.  
  208. define t_icons proc makeRockPileIcon()list int:
  209.     list int li;
  210.  
  211.     li := CreateIntArray(8);
  212.     li[0] := 0b00000000000000000000000000000000;
  213.     li[1] := 0b00000000000000000000000000000000;
  214.     li[2] := 0b00000000000000000000000000000000;
  215.     li[3] := 0b00000000000000000000110001110000;
  216.     li[4] := 0b00010010100010000001101110000100;
  217.     li[5] := 0b00110100101101000010100001001100;
  218.     li[6] := 0b01001011010100100100110010001010;
  219.     li[7] := 0b00110011011101000000000000000000;
  220.     li
  221. corp;
  222.